package com.yc.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */


public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "9021000138655985";

	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCEYPHb+uNgAr07WKkJKOgBYhiEuScxKhoUVT9yX8DciGXaQYoAcY1XR3YAtoh/wnB3AAzW4GJfV78tMZ3I5UmAdrW5+LZHKxQaFLDLMVuDuS4FtNeCey6rFwx5ojOZiYYU/mZzHHM8xsbvbpQGt0RTopFAQcMIOYKVp8zcXS66Uu+RQnKW1I5byCl7rWmIzuiIu8jTUUqdLEjkXOeawWH8UgkqbPgcyqAF4DS3P9gLyBi+i+mM6BQQGTWfFX3fGImOQQ76feaD3/WgK988MO3Oz7aMo7u35737kdiQextbIWF0TPj2ENjoR9Y7kMZq4PlODZedbprE6WbqvfyGHAbBAgMBAAECggEAEWQzIjVp3dk+Rye0vXFUWaorknRIw9rGJlm0xi/yRIbe6reli71fVlIbHKjecfp3kAq/pRNBmUkL4sIb+qK0712pLk+QkvUD5RFG0MshPML9Wt6RWaEZVnzmtKwsn0VECkoJ56GbOibbR+V9KQy2u04mSwzYtKHpmAO9lE3hr7S5SAti5jq4H9MplOwLC8bUpagq3lUXjdV9qJSWr7d5E1krLNYUnLdqpydnncuNfwBWcXUANEzBtCmhBi61+dRUEtS2c/9HICHhICaU0cSp+DeZMNgJdXtGWogdHsRfEF4IcA4wk7rNwNN6JyRfgSzur+DoLiBFh0ghvzUMltBeYQKBgQC7IYDPXaeUlaN6avohS/T6+t2yHl0vv4QF0DCK7LMp+HUFH6KX0e541/VN7FD9lMo0CFcmVT4mGWilNMeBljNre/6L87s/ZUW49+mYLK4+0drn8r/LogBOSGlhxuIbXGAve09Wnk8ETI1PdRGhFT41Rj4/nfqFx37WmCojL7hXxQKBgQC1GPndNr+6ArNcG6c2KlxxUNTbG3lAiiLlPWAtsWGBump4Hn7uNqQJQEpwqHe0glrLn5DxzMZ5FgxI0vjio5I5oQN/2oaeVg3cQy0E+9e6M3CSpYJYdlXttqcTsP50HBkfABulQk71RBlYX6ouB6nJavOOf0qVzlRaOnhhwYSmzQKBgBLD7VLeJWv1BYvFJogoQczZU1oFSXr8TZT3p6aGzgCrdbCp13g6CRv9LBBAXm7PeOd23qZtbeoMKj5G6KrKESX6LTCDpIda9H7z/WzRLjgGe1k/MpSNDlLLWCYB97KetNaOGwqonWvk8VbCep4Yr0BQZvWiNfksZD/IypD0vBuxAoGBAKfsFdxipNs1H90boyvdkcRdAFJ/IiqPLBZGmAUmglSJZ6okFOyL7ATMAXp/LChL6yb+uacMi0jCAfgQ8EkvBSq8u4L1PXhaMRX5kCgb4gg9JHhGUhv29myqvjfLGdbOKxkMv5W4a4CPebTxV9rArlYe/uI19BH+tUbJCtESYQ9NAoGAU98mgAWGcsTR5NbMaTgwUJE4WrUGHpZDB/mSxC0w/GPTgSN7z/ZhMU0YHAplKBFqrLhJLfGeafF5j2I4SvMJ/CMDsoSRp0C4q7dWFDrZaozhWkpcFCR0r5AZGI1+7zJLuY84WidV9GF+SWL8jkEeN6wMz2etNlUgiWVQQ8dBdz8=";

	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
        public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkmDQGEVJL+6MkJu+g21zA4XHWoEXxmrGdoUXJW0aA5XQqKYwvT7uSZmH750Yoft2tyAge8b25OdpnQ/g9U+XNzJ7kmsy7leBXtizk1JkVS6GIli4+UohuktjzUn7nG8VFKOO65J8KMxC85glVqHnM4KQUp+55BAXqXKoBCCk2vdA2YCH7jHiq3TkeKXk0FWq7Z9m0OaBWlE+T888gvBqa6UVOWj5ert8WmrCZUDMLXLltzx9qL/aCcuE9CCMyJhH3Za+JGbfnLIsPfej1Tp0cBrDEiIqN+o8JI50l6JW8Zx/1FvnULFipp1UARMRJOv+/5NlM+ZtJ54IT1joQSFMoQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://8.138.124.55:8080/ordersysFront/html/orderList.html";

	// 签名方式
	public static String sign_type = "RSA2";

	// 字符编码格式
	public static String charset = "utf-8";

	// 支付宝网关
	public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";
	// 支付宝网关
	public static String log_path = "C:\\";
//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

